tests: skip test-commit-sign.sh when not root
authorGiuseppe Scrivano <gscrivan@redhat.com>
Thu, 2 Apr 2015 12:21:52 +0000 (14:21 +0200)
committerGiuseppe Scrivano <gscrivan@redhat.com>
Fri, 3 Apr 2015 07:57:20 +0000 (09:57 +0200)
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
tests/test-commit-sign.sh

index 784832473278ee4e7ed24badb6bfb9ccd39008a5..01a3a2ed1eabc9e952d1f74259cd1b177c91ff72 100755 (executable)
@@ -23,6 +23,12 @@ if ! ${CMD_PREFIX} ostree --version | grep -q -e '\+gpgme'; then
     exit 77
 fi
 
+# Skip the test when non-root as gpgme would not read files owned by
+# another user.
+if test "$(id -i)" != "0"; then
+    exit 77
+fi
+
 . $(dirname $0)/libtest.sh
 
 keyid="472CDAFA"